home *** CD-ROM | disk | FTP | other *** search
AMOS Source Code | 1996-01-17 | 3.0 KB | 89 lines |
- ' ************************************* Commands used:
- ' * * Turbo Draw =Qcos
- ' * Amcaf Examples * Blitter Fill
- ' * Shade Bobs 2 V1.1 * Blitter Clear
- ' * Written by Chris Hodges * Shade Bob Up
- ' * * Shade Bob Down
- ' ************************************* =Qsin
- '
- ' Hide the mouse cursor
- Hide
- ' First open a little screen to draw some objects
- Screen Open 0,64,64,2,Lowres
- Curs Off : Flash Off : Paper 0 : Pen 1 : Cls
- ' We don't want the user to see the drawing process, so we hide the screen.
- Screen Hide
- ' Now draw some shapes and pick them up.
- ' I is the counter of the BOB number.
- I=1
- ' We'll need 16 frames, and we must rotate the star 45 degrees.
- For A=0 To 127 Step 8
- ' Draw the edges
- For B=0 To 16
- ' Every second egde must be inside.
- If B and 1
- X2=32+ Extension_8_1114(A+B*64,31) : Y2=32+ Extension_8_1106(A+B*64,31)
- Else
- X2=32+ Extension_8_1114(A+B*64,16) : Y2=32+ Extension_8_1106(A+B*64,10)
- End If
- ' Draw the line in Blitter Mode.
- If B
- Extension_8_1016 X1,Y1 To X2,Y2,1,-1
- End If
- X1=X2 : Y1=Y2
- Next
- ' Fill the shape.
- Extension_8_1042 0,0
- ' And take it out.
- Get Bob I,0,0 To 64,64
- ' Set the Hot Spot to the middle
- Hot Spot I,31,31
- ' And increase the image counter.
- Inc I
- ' Clear the screen to allow a new star to be drawn.
- Extension_8_121C 0,0
- Next
- ' Now we open the screen, we want to draw the shade bobs on.
- ' This screen should have many colours, and must be single buffered.
- Screen Open 0,320,256,32,Lowres
- Curs Off : Flash Off : Paper 0 : Pen 1 : Cls
- ' Create a nice looking palette.
- For A=0 To 7 : Colour A,A*2 : Next
- For A=0 To 7 : Colour A+8,A*$20+$F : Next
- For A=0 To 7 : Colour A+16,$1FF+A*$200 : Next
- For A=0 To 7 : Colour A+24,$FFF-A*$222 : Next
- ' These are the three angles, we use to create some sine flying path.
- W1=0 : W2=512 : W3=256
- ' These angles are needed for the shade bob, that wipes out the old bob.
- F1=0 : F2=512 : F3=256
- ' I is again an image pointer, and T is to count the frames.
- I=1 : T=0
- Repeat
- ' Wait Vbl to sychronisize to the raster beam.
- Wait Vbl
- ' Move the star by adding something to the angles.
- Add W1,9
- Add W2,7
- Add W3,4
- ' Calculate a basic sine flying path.
- X= Extension_8_1114(W1, Extension_8_1106(W1-W3,160))+160 : Y= Extension_8_1106(W3+W1, Extension_8_1106(W1-W2,128))+128
- ' Draw the Shade Bob on screen 0 at coords x,y using image I.
- Extension_8_0F84 0,X,Y,I
- ' Increase the frame value...
- Inc T
- ' Is it time to kill the old bobs?
- If T>128
- ' Follow exactly the same path, by adding the same values.
- Add F1,9
- Add F2,7
- Add F3,4
- ' Also, use the same formula.
- X= Extension_8_1114(F1, Extension_8_1106(F1-F3,160))+160 : Y= Extension_8_1106(F3+F1, Extension_8_1106(F1-F2,128))+128
- ' And draw the bob.
- Extension_8_0F9E 0,X,Y,I
- End If
- ' Increase the bob image.
- Add I,1,1 To 16
- Until Inkey$=Chr$(27) or Mouse Key<>0
- Screen Close 0
- End